package com.sgb.businessmodule;

import android.content.Context;

import com.sgb.businessmodule.api.BusinessAPI;
import com.swgk.core.base.api.APIManager;
import com.swgk.core.util.SharedPreferenceUtil;

public class BusinessConfig {

    private static BusinessConfig instance;
    private BusinessAPI api;

    public static BusinessConfig getInstance() {
        if (instance == null) {
            synchronized (BusinessConfig.class) {
                if (instance == null) {
                    instance = new BusinessConfig();
                }
            }
        }
        return instance;
    }

    public static void init(Context context) {
        SharedPreferenceUtil.init(context);
    }

    public BusinessAPI getApi() {
        if (api == null) {
            api = APIManager.getInstance(false, false).create(BusinessAPI.class);
        }
        return api;
    }
}
